<?php
/**
 * @version		$Id: almhoster.php 3 2011-12-16 20:19:15Z netix.mail@gmail.com $
 * @package		ALM Hoster
 * @desription	Web hosting and domain menager for resellers
 * @subpackage	Components
 * @copyright	Copyright (C) 2011 ALM Studio. All rights reserved.
 * @author		ALM Studio
 * @email		info@alm-studio.net
 * @link		http://alm-studio.net
 * @license		Commercial
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.modelitem');


class AlmHosterModelAlmHoster extends JModelItem
{	
	
	public function check_user() {
		
		$app = JFactory::getApplication();	
		$user	= JFactory::getUser();
		$db = JFactory::getDBO();
		
		$query = $db->getQuery(true);
		$query->select('ClientId');
		$query->from('#__almh_clients');
		$query->where('ClientUser =' .$user->get('id'));
		$db->setQuery($query);
		$clientUser = $db->loadResult();
			
			if (!$clientUser) {
			 $app->redirect( $url_notclient, $msg );		
			} else {
				$app->redirect( $url_client );
			}
		
		return true;
	}

}
